package day5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class SexTest {
    public static void main(String[] args) {
        Sex s=Sex.男;
        String name = s.name();
        int weizhi = s.ordinal();
        System.out.println(name+","+weizhi);
        //String ->Sex
        //Sex.valueOf()

        Scanner in=new Scanner(System.in);
        Student stu=new Student();
        System.out.println("请输入姓名：");
        stu.setName(in.next());
        System.out.println("请输入性别：");
        stu.setSex(Sex.valueOf(in.next()));
        System.out.println(stu);

        switch (stu.getSex()){
            case 男:
                System.out.println("男生");
                break;
        }
    }
}
